/*
 * @Description: 
 * @Author: charles
 * @Date: 2021-11-15 11:36:28
 * @LastEditors: charles
 * @LastEditTime: 2021-11-15 11:42:31
 */
import {connect} from 'react-redux'
import {useEffect} from 'react'
function Article(props){
  const dispatch = props.dispatch;

  useEffect(()=>{
    dispatch({type:"loadArticles"})
  },['props.articles'])

  return (
    <div>
      <h2>资讯管理</h2>
      <ul>
        {
          props.articles.list.map(item=>{
            return (
              <li key={item.id}>
                {item.title}
              </li>
            )
          })
        }
      </ul>
    </div>
  )
}
export default connect(state=>state)(Article);
